-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: search input a11y issue #679
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
👏 @endiliey , you are now a DocSearch collaborator 🚀 |
s-pace
pushed a commit
that referenced
this pull request
May 13, 2019
Reverting since: DocSearch › constructor › should allow customize algoliaOptions without loosing default options
TypeError: Cannot read property 'getAttribute' of undefined
81 | this.autocompleteOptions.cssClasses.prefix =
82 | this.autocompleteOptions.cssClasses.prefix || 'ds';
> 83 | this.autocompleteOptions.ariaLabel = this.autocompleteOptions.ariaLabel || $(this.input)[0].getAttribute('aria-label') || 'search input';
| ^
84 |
85 |
86 | this.isSimpleLayout = layout === 'simple'; |
Do you have an idea @endiliey ? |
$(this.input)[0] might be undefined. I should've used a safe getter like $(this.input)[0] && $(this.input)[0].getAttribute('aria-label') |
Ok, feel free to submit a new PR :) |
s-pace
pushed a commit
that referenced
this pull request
May 13, 2019
### Bug Fixes * **deps:** update dependency autocomplete.js to v0.35.0 ([2d67a21](2d67a21)) * **deps:** update dependency autocomplete.js to v0.36.0 ([bbd4ef5](bbd4ef5)) * **security:** Fix dependencies to avoid infected event-stream ([9f93ffb](9f93ffb)) * docsearch input should have aria-label (a11y) ([#687](#687)) ([59d21f5](59d21f5)) * search input a11y issue ([#679](#679)) ([a68d2a4](a68d2a4))
s-pace
pushed a commit
that referenced
this pull request
Aug 22, 2019
s-pace
pushed a commit
that referenced
this pull request
Aug 22, 2019
s-pace
pushed a commit
that referenced
this pull request
Aug 22, 2019
### Bug Fixes * **deps:** update dependency autocomplete.js to v0.35.0 ([2d67a21](2d67a21)) * **deps:** update dependency autocomplete.js to v0.36.0 ([bbd4ef5](bbd4ef5)) * **security:** Fix dependencies to avoid infected event-stream ([9f93ffb](9f93ffb)) * docsearch input should have aria-label (a11y) ([#687](#687)) ([59d21f5](59d21f5)) * search input a11y issue ([#679](#679)) ([a68d2a4](a68d2a4))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
EDIT: See #687
This PR was reverted because of failing test. See the new PR above
#418
The search input does not have
aria-label
. I have found the underlying cause, it is because we are not passingariaLabel
options to autocomplete.jsSee https://github.com/algolia/autocomplete.js/#global-options
My implementation is
ariaLabel
aria-label
search input
as aria-labelTest Plan
Here is my input
Before
No aria-label
After
aria-label exist